import request from '@/store/request'

/**
 * 列表查询接口
 * @param params
 */
export function loadAppUserDatas(params) {
  return request({
    url: 'app/user/list',
    method: 'get',
    dataType: 'json',
    params: params
  })
}


/**
 * 详情查询接口
 * @param id
 */
export function loadAppUserDetail(id) {
  return request({
    url: 'app/user/detail/' + id,
    method: 'get',
    dataType: 'json'
  })
}

export function addAppUser(params) {
  return request({
    url: 'app/user/add',
    method: 'post',
    data: params,
    dataType: 'json'
  })
}

export function editAppUser(params) {
  return request({
    url: 'app/user/edit',
    method: 'post',
    data: params,
    dataType: 'json'
  })
}

export function resetUserPassword(params) {
  return request({
    url: 'app/user/resetPass',
    method: 'post',
    data: {
      userId: params.userId,
      password: params.password
    },
    dataType: 'json'
  })
}


export function modifyStatus(userId,status) {
  return request({
    url: 'app/user/edit/status',
    method: 'post',
    data: {
      userId: userId,
      status: status
    },
    dataType: 'json'
  })
}

/**
 * 平台用户列表查询接口
 * @param params
 */
export function loadPlatAppUsers() {
  return request({
    url: 'app/user/plat/list',
    method: 'get',
    dataType: 'json'
  })
}
